<html lang="en" xmlns:th=http://www.thymeleaf.org xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
          integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"
            integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
            crossorigin="anonymous"></script>

    <style>
        td {
            padding: 1rem;
            border: 1px solid gray;
            text-align: center;
        }
    </style>

</head>

<body>


<table>
    <thead>
    <tr>
        <td>project</td>
        <td>package</td>
        <!--<td>just download</td>-->
        <td>git push msg</td>
        <td>download push deploy</td>
        <td>redeploy daily</td>
        <!--<td>upload all</td>-->

    </tr>
    </thead>
    <tbody>

    <tr th:each="l:${list}">
        <td th:text="${l.key}"></td>
        <td><a class="dabao" href="javascript:" data-th-file="${l.key}"
               branch="origin/develop"> develop</a>
            <a class="dabao" href="javascript:" data-th-file="${l.key}"
               branch="origin/master"> master</a>

        </td>

     <!--   <td th:if="${l.pub==0}"><textarea class="msg">  </textarea></td>
        <td th:if="${l.pub==0}">
            <button class="upload btn btn-default" dev="daily" all="0">daily</button>
            <button class="upload btn btn-default" dev="rc" all="0">rc</button>
            <button class="upload btn btn-default" dev="online" all="0">online</button>
            <input type="hidden" class="pak" th:value="${l.key}">
            <input type="hidden" class="file" th:value="${l.key}">
        </td>
        <td th:if="${l.pub==0}">
            <a class="restart" href="javascript:" data-th-file="${l.key}"
            > restart</a>
        </td>


        <td th:if="${l.pub==1}">public pro</td>
        <td th:if="${l.pub==1}"><a class="download" href="javascript:" data-th-file="${l.key}"
        > download</a>
        </td>
-->
    </tr>
    <tr>
        <td> push</td>

        <td> only push ios crts</td>
        <td>
            <button class="crt btn btn-default" dev="daily" all="0">daily</button>
            <!--<button class="crt btn btn-default" dev="rc" all="0">rc</button>-->
            <button class="crt btn btn-default" dev="online" all="0">online</button>
        </td>
        <!--<td>upload all</td>-->

    </tr>
    </tbody>

</table>
<div>

    <table>

    </table>


</div>
<div>

    <script>
        $(document).ready(function () {
            $('.upload').click(function () {


                var msg = $(this).parent().parent().find('.msg').val();
                var pak = $(this).parent().parent().find('.pak').val();
                var file = $(this).parent().parent().find('.file').val();



                $.post("/git/download_push_deploy", {
                    file: file,
                    dev: $(this).attr('dev'),
                    msg: msg,
                    file: file
                }, function (data) {

                    alert(data)
                })
                ;
            });
            $('.crt').click(function () {
                $.post("/git/crts", {dev: $(this).attr('dev')}, function (data) {

                    alert(data)
                })
                ;
            })

            $('.download').click(function () {



                var pack = $(this).attr('file');



                $.post("/rm/file", {file: pack}, function (data) {


                    alert(data)


                })
                ;
            });
            $('.dabao').click(function () {


                var pack = $(this).attr('file');
                var branch = $(this).attr('branch');
                console.log(url + "  " + pack)
                $.post("/jenkins/package", {file: pack, branch: branch}, function (data) {


                    alert(data)


                })
                ;
            });
            $('.restart').click(function () {


                var pack = $(this).attr('file');
                var branch = $(this).attr('branch');

                $.post("/jenkins/redeploy", {file: pack, dev: 'daily'}, function (data) {


                    alert(data)


                })
                ;
            })
        })


    </script>


</div>
</body>
</html>